<template>
	<div>
		<u-tabs :list="list" :is-scroll="false" :current="current" @change="change"></u-tabs>
		<myMap v-show="current==0" :deviceId="deviceId"></myMap>
		<historyData v-if="current==1"></historyData>
		<setting v-if="current==2"></setting>
	</div>


</template>


<script>
	import historyData from "../historyData/historyData.vue"
	import myMap from "../myMap/myMap.vue"
	import setting from "../setting/setting.vue"

	export default {
		onLoad: function(option) { //option为object类型，会序列化上个页面传递的参数
			
			//option.title为设备号 
			this.deviceId = option.title;
		},
		created() {
			
		},
		components: {
			historyData,
			myMap,
			setting
		},
		data() {
			return {
				deviceId:"",
				list: [{
						name: '实时地图'
					},
					{
						name: '历史数据'
					},
					{
						name: '阈值设置',

					},
				],
				current: 0
			}
		},
		methods: {
			change(index) {
				this.current = index;
			}
		}
	}
</script>